<%@page contentType="text/html; charset=utf-8"%>
<%@ include file="../inc/TagLibs.jsp"%>
<c:set var="pageTitle" value="项目类型" />
<%@ include file="../inc/Title.jsp"%>
<head>
<link rel="stylesheet" type="text/css" href="/css/base.css" />
<script language="javascript">
	function doSave(flag){
       document.getElementById("buttonDiv").style.display="none";
	   document.getElementById("waitDiv").style.display="";
	   document.getElementById("continue_flag").value=flag;
	   frm.submit();
	}
	function doCancel(){
		parent.ClosePop();
	}
	function showMe(){
		showFormErrorMsg();
		document.getElementById("makeType.typeName").focus();
	}
	function changeAutoStoc(val){
		document.getElementById("makeType.autoStoc").value=val;
	}
</script>
</head>
<body onLoad="showMe();"  onLoad="showMe();" class="sheet modal-dialog" style=" padding-top:15px;">
<div class="sheet-main" id="bodyDiv" style="width:325px;">
	<form name="frm" method="post">
	  <div class="sheet-list" style="width:100%">
	    <div class="modal-main search-business">
	    	<div style="width:100%;">
				<c:if test="${id==null || id==''}"><c:set var="pageTopTitle" value="新增项目类型" /></c:if>
				<c:if test="${id!=null && id!=''}"><c:set var="pageTopTitle" value="编辑项目类型" /></c:if>
				<c:set var="pageTopMark" value="" />
				<%@ include file="../inc/PageTop.jsp"%> 
				<table border="0" cellspacing="1" cellpadding="1" align="center" class="table-a">
					<tr>
				      	<th><span class="MustInput">*</span>名称：</th> 
				      	<spring:bind path="command.makeType.typeName">
				      	<td>
				      		<input type="text"  class="TextBox" maxlength="15" onKeyUp="goNextInput('makeType.unit');" id="${status.expression}" name="${status.expression}" value="<c:out value="${status.value}" />">
							  <script language="javascript">
								setFormErrorMsg('<c:out value="${status.errorMessage}" />',1);
							  </script>
				     	</td>
				     	</spring:bind>
					</tr>
					<tr>
				      	<th>成品计量单位：</th> 
				      	<spring:bind path="command.makeType.unit">
				      	<td>
				      		<input type="text"  class="TextBox" maxlength="15" onKeyUp="goNextInput('lossRateStr');" id="${status.expression}" name="${status.expression}" value="${status.value}">
							  <script language="javascript">
								setFormErrorMsg('<c:out value="${status.errorMessage}" />',1);
							  </script>
				     	</td>
				     	</spring:bind>
					</tr>
					<tr>
				      	<th>上级类别：</th> 
						<spring:bind path="command.makeType.parentId">
				      	<td>
							<select id="${status.expression}" name="${status.expression}" style="width:140px">
								<option value="0">==请选择==</option>
				  				<commonTag:createSelectTree list="${makeTypeList}" emptyOption="0" defaultValue="${status.value}" />
				  			</select>
					          <script language="javascript">
					          	setFormErrorMsg('<c:out value="${status.errorMessage}" />',2);
					          </script>
				     	</td>
						</spring:bind>
					</tr>
					<tr>
				      	<th>类型：</th>
				      	<spring:bind path="command.makeType.type">
				      	<td>
				      		<select id="${status.expression}" name="${status.expression}">
								<option value="1" <c:if test="${status.value==1}">selected</c:if>>自制</option>
								<option value="2" <c:if test="${status.value==2}">selected</c:if>>外协</option>
				  			</select>
					          <script language="javascript">
					          	setFormErrorMsg('<c:out value="${status.errorMessage}" />',3);
					          </script>
				     	</td>
				     	</spring:bind>
					</tr>
					<tr>
				      	<th>工作中心：</th>
				      	<spring:bind path="command.makeType.workCenterId">
				      	<td>
				      		<select id="${status.expression}" name="${status.expression}">
								<option value="0">==请选择==</option>
								<c:forEach var="item" items="${workCenterList}">
									<option value="${item.id}" <c:if test="${status.value==item.id}">selected</c:if>>${item.wcName}</option>
								</c:forEach>
				  			</select>
					          <script language="javascript">
					          	setFormErrorMsg('<c:out value="${status.errorMessage}" />',3);
					          </script>
				     	</td>
				     	</spring:bind>
					</tr>
					<tr>
				      	<th>自动扣库存：</th>
				      	<td>
				      		<input type="radio" name="r_autoStoc" id="r_autoStoc2" onClick="changeAutoStoc('Y');" <c:if test="${command.makeType.autoStoc=='Y'}">checked</c:if>>是
				      		<input type="radio" name="r_autoStoc" id="r_autoStoc1" onClick="changeAutoStoc('N');" <c:if test="${command.makeType.autoStoc=='N'}">checked</c:if>>否
							<spring:bind path="command.makeType.autoStoc">
							<input type="hidden" name="${status.expression}" id="${status.expression}" value="${status.value}">
					        <script language="javascript">
					          	setFormErrorMsg('<c:out value="${status.errorMessage}" />',4);
					        </script>
					        </spring:bind>
				     	</td>
					</tr>
					<tr>
				      	<th>损耗率：</th>
				      	<spring:bind path="command.lossRateStr">
				      	<td>
				      		<input type="text" class="TextBox" maxlength="5" onKeyUp="goNextInput('makeType.sequCode');" id="${status.expression}" name="${status.expression}" value="${status.value}">%
					        <script language="javascript">
					          	setFormErrorMsg('<c:out value="${status.errorMessage}" />',5);
					        </script>
				     	</td>
				     	</spring:bind>
					</tr>
					<tr>
				      	<th><span class="MustInput">*</span>序号：</th> 
				      	<spring:bind path="command.makeType.sequCode">
				      	<td>
				      		<input type="text" class="TextBox" maxlength="20" onKeyUp="goNextInput('');" id="${status.expression}" name="${status.expression}" value="${status.value}">
							<script language="javascript">
								setFormErrorMsg('<c:out value="${status.errorMessage}" />',6);
							</script>
				     	</td>
				     	</spring:bind>
					</tr>
				</table>
			</div>
	  	</div>
	  </div>
		<div class="modal-buttom" id="buttonDiv">
			<input type="button" class="buttom-a" value=" 保 存 " onClick="doSave('0');">
			<input type="button" class="buttom-a" value="保存并新增" onClick="doSave('1');">
			<input type="button" class="buttom-a" value=" 取 消 " onClick="doCancel();">
			<input type="hidden" name="continue_flag" id="continue_flag" value="0">
		</div>
		<div class="modal-buttom" id="waitDiv" style="display:none">
			<span style="color:#ffffff">请稍候...</span>
		</div>
	</form>
</div>		
</body>
</html>